home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 8: LINUX Games
/
Linux Cubed Series 8 - LINUX Games.iso
/
games
/
fortune-.tar
/
fortune-
/
fortune
/
util
/
README.ansify
< prev
next >
Wrap
Text File
|
1995-10-19
|
4KB
|
64 lines
NOTA BENE:
This is an abandoned program; on reflection, it attempts to solve the
problem in the wrong way. Instead, I'm going to enhance fortune, using
termcap or terminfo links. In order to get this (working) fortune out as
soon as possible, though, I'm releasing it now, without terminal
enhancements (interesting way to put it, huh?). So this is dead code,
ignore it; it's here so I can look at it when I enhance fortune itself.
Umm. ansify may or may not be a finished program when this distribution
goes out. If 'make ansify' works from the top-level directory, then I've
hacked it enough for minimal functionality. If not, not. If there isn't
a target, the code is probably incomplete; I don't write code from
beginning to end, straight through.
What it does: well, maybe nothing.
On the other hand, if it does something, what it should be doing is
reading a text file and looking for the character ^H (control-H, ascii
0x08, the 'backspace' character). On most terminals, printing a
character, ^H, and another character results in the terminal backing up
and overstriking. Fancy terminals can do underlines this way, if the
character set is 'transparent'. Most can't, so it's just extra dreck in
the text file. So, what ansify does, is tries to figure out which of a
limited number of uses the ^H is being put to (double-striking, which
makes bold characters, underlining, and accented characters), and then
replaces that with a VT100 control sequence that does the same thing.
Of course, a text file containing VT100 control sequences isn't going to
look like much on a terminal that doesn't understand VT100 control
sequences, so if your terminal doesn't understand such sequences, there
are two possible solutions: 1) don't use ansify, and 2) wait for the
version that reads a configuration file. The configuration file will
permit you to establish arbitrary control sequence strings for bold and
underline (and maybe for normal text, I dunno); the next stage of upgrade
will be to also permit definition of certain accented characters (so that
'^He will display as e-acute). That last stage is problematic, since
character sets can differ on the same computer, as for instance the
built-in character set for text mode versus the fonts used in an xterm.
So the configuration file really *should* be able to distinguish between
terminal types. But don't count on it.
The reason that this is included here is because I want to have it to run
on my personal fortunes databases, so that fortunes actually have a way
of emphasizing words. But it isn't very important, so I'm hacking it
rather idly (and I'm not really a top-notch programmer, so there may be
some really ugly code in there (q.v. the fortune: "This algorithm is
really nasty. You might want to mug somebody with it.")). The
distributed databases will use the traditional format.
Come to think of it, there ought to be a de-ansify, too. Worry about
that later.
As of Columbus Day 1995, it compiles. I've no idea whether it works or
not at this point, but it does compile cleanly (I'm putting most of my
energy into getting a working fortune/strfile/unstr with cleaned-up
databases together, so I haven't done much except to write the
skeleton--if the thing actually works, I'll be very, very surprised).
That it compiles doesn't prove anything except that the syntax is
correct; if you try to run this, I'd suggest that you watch it closely,
and not rely on it to produce anything useful. (If I ever get it in
working order, I'll change this README).
Amy A. Lewis alewis@email.unc.edu October 1995